home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / Apps / DevTools / ClassEditor.0.4 / Source / MiscSources.subproj / MiscString_more.m < prev    next >
Encoding:
Text File  |  1995-02-23  |  1.0 KB  |  52 lines

  1. /* MiscString_more.m                 
  2.  *
  3.  * This object controls the data of a beaker (molecules, cameras, groups etc.)
  4.  * It is the main document of BeakerBoy and controls everything from loading to
  5.  * setting up the browser which does most of the other work.
  6.  *
  7.  * For interface-info see the header file. The comments in this file mostly
  8.  * cover only the real implementation details.
  9.  *
  10.  * Written by:         Thomas Engel
  11.  * Created:            23.10.1993 (Copyleft)
  12.  * Last modified:     12.11.1994
  13.  */
  14.  
  15.  
  16. #import "MiscString_more.h"
  17.  
  18. @implementation MiscString ( More )
  19.  
  20. - squashAllWhiteSpaces
  21. {
  22.     // Just a fake right now..
  23.     
  24.     [self squashSpaces];
  25.     return self;
  26. }
  27.  
  28. - addExtensionIfNeed:(const char *)aString
  29. {
  30.     id    ourExtension;
  31.     
  32.     if (!aString) return nil;  // maybe we should _strip_ extensions here
  33.     
  34.     ourExtension = [self fileExtension];
  35.  
  36.     if( [ourExtension length] == 0 ||
  37.         [ourExtension cmp:aString] != 0 )
  38.     {
  39.         [self addCharToEndOfString:'.'];
  40.         [self cat:aString];
  41.     }    
  42.     [ourExtension free];
  43.     return self;
  44. }
  45. @end
  46.  
  47. /*
  48.  * History: 13.01.95 Buh
  49.  *            
  50.  *
  51.  * Bugs: - ...
  52.  */